Skip to content

Conversation

nik9000
Copy link
Member

@nik9000 nik9000 commented Aug 12, 2025

Adds toString checking for aggregators to the generic aggs test cases so we can make sure they spit out sensible looking results. We have this for scalar functions but it isn't plugged in for aggs and I noticed it while working on #132603 where I stuck asdf for the toString thinking I'd fix it when the test failed. It didn't.

There's to many changes to grab this in one go so I've made a hook that tests can opt into. We'll drop the hook once everything has opted into it.

Adds `toString` checking for aggregators to the generic aggs test cases
so we can make sure they spit out sensible looking results. We have this
for scalar functions but it isn't plugged in for aggs and I noticed it
while working on elastic#132603 where I stuck `asdf` for the toString thinking
I'd fix it when the test failed. It didn't.

There's to many changes to grab this in one go so I've made a hook that
tests can opt into. We'll drop the hook once everything has opted into
it.
@nik9000 nik9000 requested a review from ivancea August 12, 2025 01:59
@nik9000 nik9000 added >test Issues or PRs that are addressing/adding tests :Analytics/ES|QL AKA ESQL v9.2.0 labels Aug 12, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Aug 12, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

Copy link
Contributor

@ivancea ivancea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Maybe we should make an issue to remove the optIn flag

@@ -187,6 +190,7 @@ private void aggregateGroupingSingleMode(Expression expression) {
assumeFalse("Grouping aggregations must receive data to check results", pages.isEmpty());

try (var aggregator = groupingAggregator(expression, initialInputChannels(), AggregatorMode.SINGLE)) {
assertAggregatorToString(aggregator);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move these be their own tests, like in the scalars?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably should. I'll do that before merging.

@nik9000 nik9000 enabled auto-merge (squash) August 22, 2025 18:36
@nik9000 nik9000 merged commit 35ee644 into elastic:main Aug 22, 2025
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/ES|QL AKA ESQL Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) >test Issues or PRs that are addressing/adding tests v9.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants